package com.mezz.bones.im.common.event;

import com.mezz.bones.im.common.result.ImResultCode;
import org.springframework.context.ApplicationEvent;

import java.io.Serializable;

/**
 * @Author: zhuang
 * @Date: 2024/12/2 13:41
 * @Description: 发送消息至某一个用户
 * @Version: 1.0
 **/

public class MessageSendWithUserIdEvent extends ApplicationEvent implements Serializable {

    private String actionCode;
    private Object data;

    private Object traceId;
    private String userId;

    private ImResultCode resultCode;


    public MessageSendWithUserIdEvent(Object source, String actionCode, Object data, String userId) {
       this(source,actionCode,data,userId, ImResultCode.SUCCESS);
    }

    public MessageSendWithUserIdEvent(Object source, String actionCode, Object data, String userId, ImResultCode resultCode) {
        super(source);
        this.traceId = this.source;
        this.data = data;
        this.actionCode = actionCode;
        this.userId = userId;
        this.resultCode = resultCode;
    }



    public Object getData(){
        return data;
    }

    public String getActionCode() {
        return actionCode;
    }

    public Object getTraceId() {
        return traceId;
    }
    public String getUserId() {
        return userId;
    }

    public ImResultCode getResultCode() {
        return resultCode;
    }
}


